/* 人脸识别摄像头组件样式 */

.face-camera-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.face-camera-container {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.face-camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
}

.face-camera-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.face-camera-close-btn {
  padding: 8px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 20px;
}

.face-camera-close-btn:hover {
  background: #f5f5f5;
  border-radius: 50%;
}

.face-camera-preview {
  position: relative;
  width: 100%;
  height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.face-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 镜像翻转，更符合用户习惯 */
}

.face-camera-error {
  color: white;
  text-align: center;
  padding: 20px;
}

.face-camera-error p {
  margin: 0 0 16px 0;
  font-size: 16px;
}

/* 人脸识别引导框 */
.face-camera-guide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.face-guide-frame {
  position: relative;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.face-guide-corners {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #1890ff;
}

.corner.top-left {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.corner.top-right {
  top: -3px;
  right: -3px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.corner.bottom-left {
  bottom: -3px;
  left: -3px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.corner.bottom-right {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

.face-guide-text {
  color: white;
  font-size: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: 120px;
}

.face-camera-controls {
  padding: 20px;
  display: flex;
  justify-content: center;
  background: white;
}

.face-camera-capture-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1890ff;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  transition: all 0.3s ease;
}

.face-camera-capture-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(24, 144, 255, 0.4);
}

.face-camera-capture-btn:disabled {
  background: #d9d9d9;
  box-shadow: none;
  transform: none;
}

.face-camera-tips {
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #f0f0f0;
}

.face-camera-tips p {
  margin: 4px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .face-camera-overlay {
    padding: 10px;
  }
  
  .face-camera-container {
    max-height: 95vh;
  }
  
  .face-camera-preview {
    height: 250px;
  }
  
  .face-guide-frame {
    width: 160px;
    height: 160px;
  }
  
  .face-guide-text {
    margin-top: 100px;
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .face-camera-capture-btn {
    width: 70px;
    height: 70px;
    font-size: 20px;
  }
}

/* 动画效果 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(24, 144, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(24, 144, 255, 0);
  }
}

.face-camera-capture-btn:not(:disabled) {
  animation: pulse 2s infinite;
}
